package xuexi;
class Arrayunit {
    public static void paixu(int[] data) {
        for (int j=0;j<data.length;j++) {
            for (int x = 0; x < data.length -j- 1; x++) {
                if (data[x] > data[x + 1]) {
                    int temp = data[x + 1];
                    data[x + 1] = data[x];
                    data[x] = temp;
                }
            }
        }
    }

    public static void showArray(int[] temp) {
        for (int i = 0; i <= temp.length-1; i++) {
            System.out.println(temp[i]);
        }
    }
}
public class shuzupaixu {
    public  static void main(String[] args){
        int[] data=new int[]{5,6,1,3,2,4};
        Arrayunit.paixu(data);
        Arrayunit.showArray(data);
    }
}
